package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.SysUserPosition;
import com.ruoyi.system.domain.SysUserPositionLevelHistory;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 用户与岗位等级关联表 每月历史数据
 *
 * @author zy
 */
public interface SysUserPositionLevelHistoryMapper {
    /**
     *
     * @param positionId
     * @param userId
     * @param nowDate
     * @return
     */
    public int insertUserPositionLevelByUserId(@Param("positionId") Long positionId, @Param("userId") Long userId, @Param("nowDate") Date nowDate);

    /**
     *  获取给定月份的所有用户岗位信息
     * @param nowDate
     * @return
     */
    public List<SysUserPositionLevelHistory> getPositionsListByNowDate(@Param("nowDate") String nowDate);

    /**
     * 获取给定月份的用户岗位信息
     * @param userId
     * @param nowDate
     * @return
     */
    public SysUserPositionLevelHistory getPositionsByUserIdAndNowDate(@Param("userId") Long userId, @Param("nowDate") String nowDate);

    public int updateUserPositionLevelHistoryByUserId(@Param("positionId") Long positionId, @Param("userId") Long userId, @Param("nowDate") Date nowDate,@Param("nowDateStr") String nowDateStr);
}
